exports.add=[
{
	_type:"controller",
	_config_details: {	
	},
	_config: {
		name:"Helpers",
	},

	/**
	 * Controller: Helpers.copy_url
	 */
	copy_url: function(config) {
		var rr=this.action;
		rr+="?";
		var skip={foreach_i:1};
		for (var i=0;i<config.skip.length;i++) skip[config.skip[i]]=1;
		for (var k in this.fields) {
			if (skip[k]) continue;
			rr+=k;
			rr+="=";
			rr+=this.fields[k];
			rr+="&";
		}
		return rr;
	}
,

	/**
	 * Controller: Helpers.copy_fields
	 */
	copy_fields: function(config) {
		var rr="";
		var skip={foreach_i:1};
		for (var i=0;i<config.skip.length;i++) skip[config.skip[i]]=1;
		for (var k in this.fields) {
			if (skip[k]) continue;
			rr+=k;
			rr+="=";
			rr+=this.fields[k];
			rr+="&";
		}
		return rr;
	},

	page_title: function() {
		var ret="";
		if (!this.pageinfo) return "";
		ret=this.pageinfo.title_override || this.pageinfo.title||"";
		if (this.action!="/index/") {
			ret+=this.site.title||"";
		}
		return ret;
	}
}];

